package com.aefan.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: jxl
 * @Date: 2021/9/16 下午4:59
 */
@Configuration
public class ApplicationContextConfig {

    @Bean
    @LoadBalanced //@LoadBalanced RestTemplate走负载均衡器
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
